Skip to content
This repository was archived by the owner on Sep 29, 2022. It is now read-only.
/ zart Public archive

Modernizing to tRPC v10 - #24

Open
zomars wants to merge 9 commits into
trpc:mainfrom
zomars:modernize
Open

zomars wants to merge 9 commits into
trpc:mainfrom
zomars:modernize

Conversation

@zomars

@zomars zomars commented Jul 12, 2022

Copy link
Copy Markdown
Collaborator

refs trpc/trpc#2118

  • Adds turborepo
  • Upgrades tRPC to v10
  • Replaces some scripts for turbo repo pipelines
  • Fixes wrong import for expo
  • Adds type safety for next.config.js

@juliusmarminge

juliusmarminge commented Jul 12, 2022

Copy link
Copy Markdown
Member

I have a repo you could look at for reference: https://github.com/juliusmarminge/turbo-expo-next-starter

@zomars
zomars requested a review from KATT July 18, 2022 19:07
@zomars
zomars marked this pull request as ready for review July 18, 2022 19:07
@zomars zomars changed the title WIP: Modernizing to tRPC v10 Modernizing to tRPC v10 Jul 18, 2022
@zomars

zomars commented Jul 18, 2022

Copy link
Copy Markdown
Collaborator Author

Please let me know if I've missed anything @KATT 🙏🏽

@KATT KATT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my phone, excited to try this out ASAP 😋

Comment thread packages/api/src/createRouter.ts
Comment thread packages/react/trpc.tsx
@@ -31,5 +128,3 @@ export type inferMutationOutput<
export type inferMutationInput<

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the remaining three inference helpers?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which helpers do you mean? @juliusmarminge

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are changing with the new major

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll do something like this instead:

import { inferProcedureOutput } from '@trpc/server';

type PostByIdOutput = inferProcedureOutput<AppRouter['post']['byId']>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh thats nice. No need for the helpers then. When will this be a thing?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a thing in V10 already

@zomars
zomars requested a review from KATT July 20, 2022 00:14
Comment thread apps/expo/utils/trpc.tsx
@@ -1 +1 @@
export * from '@zart/react/trpc';
export * from '@zart/react-native/trpc';

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing an error when running expo

@zomars

zomars commented Jul 20, 2022

Copy link
Copy Markdown
Collaborator Author

I'm trying to incorporate solito as well, should I try to upgrade expo as well? @KATT

@KATT

KATT commented Jul 20, 2022

Copy link
Copy Markdown
Member

I'm trying to incorporate solito as well, should I try to upgrade expo as well? @KATT

I would be careful about expo upgrades. Make sure the app works before and after :D

@zomars

zomars commented Jul 20, 2022

Copy link
Copy Markdown
Collaborator Author

I'm trying to incorporate solito as well, should I try to upgrade expo as well? @KATT

I would be careful about expo upgrades. Make sure the app works before and after :D

Maybe I can try on a follow up Pr

@juliusmarminge

Copy link
Copy Markdown
Member

I'm trying to incorporate solito as well, should I try to upgrade expo as well? @KATT

I would be careful about expo upgrades. Make sure the app works before and after :D

Maybe I can try on a follow up Pr

Expo just launched v46 beta with React 18 so I would hold off until thats stable

@KATT

KATT commented Jul 20, 2022

Copy link
Copy Markdown
Member

Is it working in expo now? Could you update the readme if something has changed in how you use it?

@zomars

zomars commented Jul 20, 2022

Copy link
Copy Markdown
Collaborator Author

Is it working in expo now? Could you update the readme if something has changed in how you use it?

It should be working yeah. Nothing has changed AFAIK

@Norfeldt

Norfeldt commented Aug 5, 2022

Copy link
Copy Markdown

Expo has released 46 now 🙂

@johann-taberlet

Copy link
Copy Markdown

Hey there, any news on this?
I can't wait to have a try on it 😊

@juliusmarminge

Copy link
Copy Markdown
Member

A bit of self-promotion for a more minimal setup: create-t3-turbo

@zomars

zomars commented Aug 23, 2022

Copy link
Copy Markdown
Collaborator Author

Hey there, any news on this?
I can't wait to have a try on it 😊

__

Im afraid my expo knowledge is limited, anyone feel free to take over my work on this PR. It's on a mergeable state if you ask me. Maybe upgrading expo can be a follow up.

@elevyg

elevyg commented Sep 1, 2022

Copy link
Copy Markdown

I was wondering why it is necessary to have the react-native/trpc.ts file and the react/trpc.ts file when only the latter is used.

@zomars

zomars commented Sep 1, 2022

Copy link
Copy Markdown
Collaborator Author

TBH I just kept what was already there

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants